layui.use(['tree','layer'],function (){
    let tree = layui.tree,layer = layui.layer;
})

/**
* @author: ChengJW
* @params:
* @return:
* @date: 2021/11/11
* @description: 初始化回显新增信息
*/
$(function (){
    //初始化权限信息
    showRolePermInfo();
});

/**
* @author: ChengJW
* @params:
* @return:
* @date: 2021/11/11
* @description: 放弃按钮
*/
function quitUserInfo() {
    //获取当前弹窗的索引，并关闭；parent 是 layui 定义的全局变量
    let index = parent.layer.getFrameIndex(window.name);
    parent.layer.close(index);
}

/**
* @author: ChengJW
* @params:
* @return:
* @date: 2021/11/11
* @description: 新增用户菜单信息
*/
function showRolePermInfo() {
    sendAjax("/systemDefend/roleAdmin/showAllRolePermInfo",{"roId":getValue("roId")},function (result){
        if (valueIsEqual(result.code,"00")){
            layui.tree.render({
               elem:'#tree',
                id:'treeId',
                showCheckbox: true,
               data: result.data
            });
        }else if (valueIsEqual(result.code,"02")){
            layer.msg(result.data,{icon:5,time: 1500});
        }
    });
}


